﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Core;
using System.Collections;

namespace Yuanlin.Business
{
    public class ZiCaiInfoRequest : TEntityRequest<ZiCaiInfo>
    {
        public ZiCaiInfoRequest()
        {
            int? entityId = GetParameterValue<int?>(YuanlinParameterName.ZicaiInfoId);
            if (entityId.HasValue)
            {
                EntityId = entityId.Value;
            }
        }
    }
    public class ZiCaiInfoListRequest : TEntityListRequest<ZiCaiInfo>
    {
        private int? ziCaiTopLevelCategoryId = GetParameterValue<int?>(YuanlinParameterName.ZiCaiTopLevelCategoryId);
        private int? ziCaiSecondLevelCategoryId = GetParameterValue<int?>(YuanlinParameterName.ZiCaiSecondLevelCategoryId);
        private int? areaId = GetParameterValue<int?>(YuanlinParameterName.AreaId);
        private int? areaLevel = GetParameterValue<int?>(YuanlinParameterName.AreaLevel);
        private int? kind = GetParameterValue<int?>(YuanlinParameterName.Kind);
        private int? userId = GetParameterValue<int?>(YuanlinParameterName.UserId);
        private string title = GetParameterValue<string>(YuanlinParameterName.Title);
        private string tradeType = GetParameterValue<string>(YuanlinParameterName.TradeType);

        public int? TopCategory
        {
            get
            {
                return ziCaiTopLevelCategoryId;
            }
            set
            {
                ziCaiTopLevelCategoryId = value;
            }
        }
        public int? SecondCategory
        {
            get
            {
                return ziCaiSecondLevelCategoryId;
            }
            set
            {
                ziCaiSecondLevelCategoryId = value;
            }
        }
        public int? AreaId
        {
            get
            {
                return areaId;
            }
            set
            {
                areaId = value;
            }
        }
        public int? AreaLevel
        {
            get
            {
                return areaLevel;
            }
            set
            {
                areaLevel = value;
            }
        }
        public int? Kind
        {
            get
            {
                return kind;
            }
            set
            {
                kind = value;
            }
        }
        public int? UserId
        {
            get
            {
                return userId;
            }
            set
            {
                userId = value;
            }
        }
        public string Title
        {
            get
            {
                if (!string.IsNullOrEmpty(title))
                {
                    return string.Format("%{0}%", title);
                }
                return "";
            }
            set
            {
                title = value;
            }
        }
        public string TradeType
        {
            get
            {
                return tradeType;
            }
            set
            {
                tradeType = value;
            }
        }
    }
    public class ZiCaiInfoReply : EntityReply
    {
    }
}